package com.jz.pay3.design.observer;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class Student implements Observer{
    private String name;

    private Object teaTel;

    private Subject subject;

    public Student(String name,Subject subject){
        this.name = name;
        this.subject = subject;
    }

    @Override
    public void update() {
        this.teaTel = subject.getUpdate();
    }

    @Override
    public void show(){
        System.out.println("学生【"+name+"】记录的老师tel： "+ teaTel);
    }

}
